/**
 * loadingUi
 * @author LuoDong
 * @email luo4521@online.net.tw
 * 2010-2-3 9:35
 */
package com.addcn.texas.view.components
{
	import flash.display.MovieClip;
	import flash.text.TextField;
	
	public class LoadingUi extends MovieClip 
	{
		private var _total_long : Number;
		private var _total_bytes : Number;
		private var _percent : Number;
		
		public function LoadingUi() : void 
		{
			this["progressBar"]["bar"].width = 0;
			this._total_long = this["progressBar"].width;
		}
		
		public function setTotalBytes(r_bytes : Number) : void
		{
			this._total_bytes = r_bytes;
			this._percent = this._total_long / this._total_bytes;
		}
		
		public function updateLoaded(r_loaded : Number) : void 
		{
			var _width =  (this._percent * r_loaded) >> 0;
			this["progressBar"]["bar"].width = _width;
			
		}
		
		
	}
	
}
